Is Macromedia Flex the Right Fit for You?
Table of Contents
Beyond Flex 1.0
Because Flex is a Version 1.0 product, we had to make certain tradeoffs. In general, however, we were uncompromising when it came to two things:
- Addressing customer desires to leverage existing investments in infrastructure, processes, and employee skills
- Ensuring that customers could build great guided selling, customer self-service, and dashboard-style applications
We are confident in the ability of Flex to build terrific user experiences and scale with your deployment needs. In the interest of helping you make the right decision for your specific needs, however, I want to touch on a few of the tradeoffs we made in Flex 1.0 and clear up some of the common misperceptions we heard along the way. Watch for the following in future releases of Flex.
Runtime Shared Libraries
The Flex application model contains a rich set of visual and nonvisual components that developers can use to lay out user interface elements, apply visual effects based on user interaction, trigger client-side data validation, and implement other standard application patterns. As you might expect with any object-oriented language, developers can aggregate these components into composite components and separate them into multiple MXML and ActionScript files. This allows a team of developers to create and share custom components easily.
However, it is important to note that Flex 1.0 does not support runtime shared libraries. Any Flex components that an application references are statically compiled into the downloaded Flash application. A site can certainly have multiple applications, but each will embed the components it needs. However, Flex can dynamically load assets, and because both the Flex application and the dynamically loaded assets leverage the browser cache, they're rarely downloaded multiple times by the same user.
How does this affect the size of a Flex application? Macromedia has gone to great lengths to keep Flex application sizes small. Applications built with Flex 1.0 start around 100K; reasonably complex applications range anywhere between 180–250K. Larger application sizes can result depending on the amount of business logic the developer moves from the server to the Flex application.
Large Data Sets and Performance Tuning
As I mentioned earlier, Flex supports multiple ways to connect to your server-side business logic. In fact, a number of built-in capabilities help ensure good performance. For example, Flex converts XML data into local objects "just in time" to avoid paying an upfront penalty for data that the end user may never access.
However, it is important that you understand the performance profile of the technologies you use because Flex applications are a hybrid of traditional fat-client applications and web-deployed, server-only applications. As such, you need to design the application to optimize processing using both the client and the server. The Flash runtime is designed for UI presentation and to manage client state but it is not designed to manage massive amounts of data on the client. To handle large data sets, you should build support for data paging. See Matthew Chotin's blog for an ongoing discussion of Flex applications and data management. The design patterns that Matt suggests will help ensure good application performance and maintainable implementation practices.
Skinning Versus Styling
The experience design team at Macromedia has worked with many customers over the years. This team has iteratively defined a set of user interface guidelines and carefully designed a default look and feel for Flex applications. Developers are able to leverage this aesthetic or alter the look and feel as needed using our support for styles or skins. Styling is sufficient for most customer needs. Flex ships with a handful of sample Cascading Style Sheet (CSS) files. Figures 1–3 show an example of one application styled differently with only about 10 lines of CSS. Notice what differs in each example:
- Color schemes and gradients
- Background images
- Rounded corners on the panels that constitute the application
Figure 1. Default look for the Flex application; no CSS required
Figure 2. Flex application look based on autumn.css (below)
autumn.css:
global {
font-family:"Trebuchet MS";
font-size:11px;
color:#000000;
header-colors:#DEBD84,#F7DEB5;
footer-colors:#F7DEB5,#DEBD84;
corner-radius:10;
}
Application {
themeColor:#FE8A4B;
selectionColor:#EFDEC2;
rollOverColor:#F9F2E7;
backgroundImage:"backgrounds/autumn.swf";
backgroundSize:"100%";
backgroundColor:#854230;
}
Figure 3. Flex application based on institutional.css (below)
institutional.css:
global {
font-family:"Arial";
font-size:11px;
color:#0E1D2C;
header-colors:#8BC0E7,#8BC0E7;
footer-colors:#8BC0E7,#8BC0E7;
corner-radius:4;
}
Application {
themeColor:haloBlue;
backgroundImage:"backgrounds/institutional.swf";
backgroundSize:"100%";
backgroundColor:#23476A;
}
In case this level of UI customization does not meet your needs, we provide a process for creating alternate skins associated with Flex components. While you can completely change the way your components look by updating their skins, this is not an effort for the faint of heart. We recommend that you have an expert Flash designer do the work. Although this is a powerful concept for any company that wants to create highly branded Flex applications, most customers simply brand using CSS.